const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const modelSchema = new Schema(
  {
    title: {
      type: String,
      required: true,
    },
    desc: {
      type: String,
      default: "",
    },
    coverImg: {
      type: String,
      default: "",
    },
    link: {
      type: String,
      default: "",
    },
    views: {
      type: Number,
      default: 1,
    },
    categories: {
      type: String,
      default: "",
    },
  },
  {
    timestamps: true, // 为每一条记录添加一个新增和修改的时间戳
  }
);

module.exports = mongoose.model("movie", modelSchema);
